package com.spring;

import com.spring.service.BeanService;
import com.spring.service.BeanService2;
import com.spring.service.BeanServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import(BeanServiceImpl.class)
public class BeanConfig {

    @Autowired
    private ApplicationContext applicationContext;

    @Bean(initMethod = "init", destroyMethod = "destroy")
    public BeanService2 beanService2(){
        return new BeanService2();
    }
}
